Create new Model 8

Create a new table model

General step:

-        Select Referral program Table

-        Click ReferralName

-        Click Filter and unselect this Names Job Ref, 123, Sales Repand all Name's start with Test

 

 

Step 1

                   - Copy pest Referral program Table 4 times

                   -  Rename the first table Referee

                   - Rename the Second t table Members

                   - Rename the third table Commission1

                   - Rename the third table Commission2

Step 2

 Create a Referee table

-        Select Refm_Startdate, Comission1 Reached, Comission2 Reached, RFM_Amount columns (By Using hold ctrl and click the columns)

-        Click Remove Columns

Step 3

 Create Members table

                     

-        Select RFM_Reward level, MemberName, ReferralName, Refm_Startdate columns (By Using hold ctrl and Click the columns)

-        Click Remove Column and Select Remove Other Columns

Step 4

   Create Commission1 table 

-        Select ReferralName, Refm_Startdate, Registrationdate, Commission2 Columns (By Using hold ctrl and click the columns)

-        Click Remove Column

Step 5

   Create Commission2 table 

-        Select ReferralName, Refm_Startdate, Registrationdate, Commission1 Columns (By Using hold ctrl and click the columns)

-        Click Remove Column 



Create a Date table 

Steps

-       Click on Modeling

-       Select New Table

-       Put below DAX code


   Date = ADDCOLUMNS (

CALENDAR (Min('Members'[RefM_Startdate]), TODAY()),

"Dates", FORMAT ( [Date], "MM/DD/YYYY" ),

"DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ),

"Year", YEAR ( [Date] ),

"Monthnumber", FORMAT ( [Date], "MM" ),

"YearMonthnumber", FORMAT ( [Date], "YYYY/MM" ),

"YearMonthShort", FORMAT ( [Date], "YYYY/mmm" ),

"MonthNameShort", FORMAT ( [Date], "mmm" ),

"Month", FORMAT ( [Date], "mmmm" ),

"MonthYear", FORMAT ( [Date], "mmm" ) &" "& YEAR([Date]),

"DayOfWeekNumber", WEEKDAY ( [Date] ),

"DayOfWeek", FORMAT ( [Date], "dddd" ),

"DayOfWeekShort", FORMAT ( [Date], "ddd" ),

"Quarter", "Q" & FORMAT ( [Date], "Q" ),

"YearQuarter", FORMAT ( [Date], "YYYY" ) & "/Q" & FORMAT ( [Date], "Q" )

)





 Make Relationship



How to create a new model  in power bi 

https://www.youtube.com/watch?v=NLbW9Yft-5M&t=686s